London | 25-SDC-Nov | Emiliano Uruena | Sprint 5 | Prep Exercises#306
London | 25-SDC-Nov | Emiliano Uruena | Sprint 5 | Prep Exercises#306Emilianouz wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Very good work on these tasks, there are some areas where you could improve further
There was a problem hiding this comment.
Can you describe the difference and any dis/advantage of using a class method vs a function?
Added error handling for age input and improved output formatting.
Updated print_family_tree to include indentation and level.
|
Good work, this is almost complete. One of the items mentioned in the prep task was to describe the differences between methods and functions. Could you briefly describe in a comment here what the main differences or advantages/disadvantages there are between these two ideas? |
methods are functions that belong to a class or object. and operates on the data contained within an object. Functions are reusable since they do not rely on object states. Their use could be general in a project; but a Method belong to an object, keeping the data and the logic in one package. |
|
Good answers. PR complete! |
Self checklist
Changelist
Completed all Sprint 5 prep exercises following the provided guide.
This includes: object-oriented programming concepts such as classes, inheritance, methods, dataclasses, enums, and generics.
Also worked through mypy type checking and type-guided refactoring to reinforce static typing and code quality.